<template>
  <div>
    姐姐  {{broscore}}
  </div>
</template>

<script>
import { getBooks } from '../api/books'
import evtbus from '../utils/index.js'
export default {
  data () {
    return {
      broscore: '???'
    }
  },
  async created () {
    const res = await getBooks()
    console.log(res)
  },
  // 组件实例挂载的时候时候会自动执行
  mounted () {
    evtbus.$on('tell-score', (v) => {
      this.broscore = v
    })
  }
}
</script>

<style>

</style>
